package com.jiang.service.impl;

import com.jiang.dao.IMemberDAO;
import com.jiang.factory.HibernateSessionFactory;
import com.jiang.factory.MemberDAOFactory;
import com.jiang.service.IMemberService;
import com.jiang.vo.Member;

public class MemberServiceImpl implements IMemberService {

	@Override
	public boolean save(Member m) {
		boolean flag = false;
		try{
			IMemberDAO memberDao = MemberDAOFactory.getInstance();
			flag = memberDao.doCreateMember(m);
			HibernateSessionFactory.getSession().beginTransaction().commit();
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			HibernateSessionFactory.closeSession();
		}
		return flag;
	}

}
